/*
结构体
*/
#include<stdio.h>
//PHP中不同变量值的内存结构，联合体：
typedef union _zvalue_value {
	long lval;					/* long value */
	double dval;				/* double value */
	struct {
		char *val;
		int len;
	} str;
	//HashTable *ht;				/* hash table value */
	//zend_object_value obj;
} zvalue_value;

//内存中，PHP中变量的结构体：
struct _zval_struct {
	/* Variable information */
	zvalue_value value;		/* value */
	unsigned int refcount__gc;  //gc:垃圾收集机制，php5特性
	unsigned char type;	/* active type */
	unsigned char is_ref__gc;
};

int main()
{
	struct _zval_struct *zval;
	struct _zval_struct _zval;
	zvalue_value _value;	
	
	printf("sizeof(_zval_struct) pointer = %d\n", sizeof(zval));
	printf("sizeof(_zval_struct) = %d\n", sizeof(_zval));
	printf("sizeof(zvalue_value) = %d\n", sizeof(_value));
	
	int i = 10;
	printf("press any key to continue...\n");
	getchar();
	return 0;
}


